﻿var http = require('http');
var url = require('url');
var util = require('util');

http.createServer(function (req , res){
	res.writeHead(200 , {'Content-Type' : 'text/plain'})
	var params = url.parse(req.url , true).query;
	res.write('网站名：' + params.name)
	res.write('\n网站：' + params.url)
	if (url.parse(req.url,true).pathname == '/api') {
		res.write('输出api')
	}
	res.end('\nok , is no json \n'+util.inspect(url.parse(req.url , true)));

}).listen(8080, function (){
	console.log('service in 8080 is ok !');
});